-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gradients module to stop mutating operators in-place #4220
Conversation
[sc-36756] |
Codecov Report
@@ Coverage Diff @@
## master #4220 +/- ##
=======================================
Coverage 99.79% 99.79%
=======================================
Files 351 351
Lines 32058 32111 +53
=======================================
+ Hits 31991 32044 +53
Misses 67 67
|
Will open for review after running benchmarks |
Ran an optimization workflow on a circuit with |
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 amazing!
* Remove statevector support for qinfo functions * remove unused funcs * Fix some tests * pylint * more pylint * Remove unnecessary log * Changelog and deprecations entry * trigger ci
* rename all legacy test files to match pylint pattern * pylint all tests in CI and pre-commit * lint legacy/qnn/conftest * remove the custom pylint test handling * run black before pylint * changelog --------- Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
* use bind_new_parameters * pylint * remove batching in measurements and add tests * More coverage issues * Add uncopied tests * Helper function * pylint * Make tape._ops public * use private methods * pylint * Add more docs to split_operations * pylint
* update in docs * update changelog * Test warning is raised * update default gaussian device * update tests * update more tests * fix legacy tests * Specify v0.33 removal in docstring * Render X and P in docs * move deprecation warning in docstring * fix sphinx linking * add warning box
* Support wire labels in qinfo transforms * changelog * pylint and update test * add bugfix entry
* deprecate the old return system * deprecate the mode kwarg for QNode * changelog * PR feedback * update notice to avoid wrongly suggesting action needed * update docstrings, docs and warnings * add link to qnode returns doc * change the mode warning depending on return system active * also add disclaimer to docstring
Context:
In-place mutation of operators is being removed.
Description of the Change:
generate_shifted_tapes
andgenerate_multishifted_tapes
to stop mutating operators in-place and usebind_new_parameters
instead.Benefits:
This change impacts
parameter-shift
,finite-diff
, andspsa
grad methods, which see comparable or better performance after removing in-place mutation.Possible Drawbacks:
Related GitHub Issues: